load("@rules_cc//cc:defs.bzl", "cc_binary")

package(
    default_visibility = ["//visibility:private"],
)

cc_binary(
    name = "dns-example",
    srcs = [
        "dns-example.c",
    ],
    deps = [
        "//:event_core",
        "//:event_core_private_headers",
        "//:event_extra",
    ] + select({
        "@platforms//os:windows": [
            "//WIN32-Code:getopt",
        ],
        "//conditions:default": [],
    }),
)

cc_binary(
    name = "event-read-fifo",
    srcs = [
        "event-read-fifo.c",
    ],
    deps = [
        "//:event_core",
    ],
)

cc_binary(
    name = "hello-world",
    srcs = [
        "hello-world.c",
    ],
    deps = [
        "//:event_core",
    ],
)

cc_binary(
    name = "http-connect",
    srcs = [
        "http-connect.c",
    ],
    deps = [
        "//:event_core",
        "//:event_extra",
    ],
)

cc_binary(
    name = "https-client",
    srcs = [
        "hostcheck.c",
        "hostcheck.h",
        "https-client.c",
        "openssl_hostname_validation.c",
        "openssl_hostname_validation.h",
    ],
    tags = [
        # OpenSSL 3.3.1.bcr.1 is missing symbols on macOS.
        "no_macos",
        "requires_openssl",
    ],
    deps = [
        "//:event_core",
        "//:event_extra",
        "//:event_openssl",
        "@openssl//:crypto",
        "@openssl//:ssl",
    ],
)

cc_binary(
    name = "http-server",
    srcs = [
        "http-server.c",
    ],
    deps = [
        "//:event_core",
        "//:event_extra",
    ] + select({
        "@platforms//os:windows": [
            "//WIN32-Code:getopt",
        ],
        "//conditions:default": [],
    }),
)

cc_binary(
    name = "le-proxy",
    srcs = [
        "le-proxy.c",
    ],
    tags = [
        # OpenSSL 3.3.1.bcr.1 is missing symbols on macOS.
        "no_macos",
        "requires_openssl",
    ],
    deps = [
        "//:event_core",
        "//:event_extra",
        "//:event_openssl",
        "//:event_openssl_private_headers",
        "@openssl//:crypto",
        "@openssl//:ssl",
    ],
)

cc_binary(
    name = "signal-test",
    srcs = [
        "signal-test.c",
    ],
    deps = [
        "//:event_core",
    ],
)

cc_binary(
    name = "time-test",
    srcs = [
        "time-test.c",
    ],
    deps = [
        "//:event_core",
    ],
)
